//
//  SmallVideoCell.swift
//  Trill
//
//  Created by 顾钱想 on 2019/11/11.
//  Copyright © 2019 顾钱想. All rights reserved.
//

import UIKit


@objc protocol ZFTableViewCellDelegate {
    // 播放
    @objc optional func zf_playTheVideoAtIndexPath(index:IndexPath) ->()
}

class SmallVideoCell: UITableViewCell {
    var delegate:ZFTableViewCellDelegate?
    var indexPath:IndexPath?
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        // Configure the view for the selected state
    }

    func setDelegate(delegate: ZFTableViewCellDelegate, indexPath:IndexPath) {
        self.delegate = delegate
        self.indexPath = indexPath
    }


    ///点击播放视频
    @IBAction func playBtnClick(_ sender: UIButton) {
        guard let delegate = delegate else { return  }
        self.setDelegate(delegate: delegate, indexPath: indexPath ?? IndexPath.init())
    }
    
}
